package fun.lifepoem;


import com.gemini.core.exception.ParamCheckException;
import com.gemini.utis.ObjUtil;
import com.gemini.utis.StrUtil;
import fun.lifepoem.domain.User;
import fun.lifepoem.utils.ObjectUtils;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Main {
    public static void main(String[] args) {

        User o = new User();

        o.setName("yiwyn");

        User n = new User() {
            {
                setName("cortana");
                setAge(17);
                setSummary("开心");
            }
        };

        List<String> list = new ArrayList() {{
            this.add("测试");
            this.add("支持");

        }};


        Field[] fields = o.getClass().getDeclaredFields();
        Field[] declaredFields = o.getClass().getSuperclass().getDeclaredFields();
        for (Field declaredField : declaredFields) {
            System.out.println(declaredField);
        }


        for (Field field : fields) {
            System.out.println(field);
        }

        try {
            ObjUtil.checkObjValue(o);
        } catch (ParamCheckException e) {
            System.out.println(e.getMessage());
        }


    }
}